<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of WriteOff
 *
 * @author Administrator
 */
class WriteOff extends CI_Controller
{
    var $user_data;

    function __construct()
    {
        parent::__construct();
        $gp = gp();
        $this->user_data= $this->session->userdata('users');
        $this->lang->load('wms');
        //加载模型
        $this->load->service('wms/part_write_off_service');
        $this->load->service('wms/package_service');
        
    }
    function add_package_with_items()
    {
       $gp=gp();
       $ids=json_decode($gp['ids']);
       $package_id=$this->package_service->add_write_off_ids_t($ids,$this->user_data['account']);
            if (FALSE!==$package_id)
            {
                echo '{"success":true,"id":"'.$package_id.'","msg":"'.lang('wms_tips_20021').':'.$package_id.'"}';
            }
            else
            {
                echo '{"success":false,"msg":"'.lang('wms_tips_20022').'!"}';
            }
    }
}

?>
